<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        body{
            background-color: #ADD9E6;
        }
        .bigfish{
            width: 509px;
            height: 270px;
            margin: 100px auto;
            background: url(./老胡来也_23级H5CSS3练习_files/shark2.png)left top;
            animation: Swim 1s steps(8) infinite; 
            display: inline-block;
        }
        .box1{
            width: 509px;
            height: 270px;
            animation: SwimBox 20s linear infinite;
            display: inline-block;
            
        }
        @keyframes Swim{
            0%{
                
            }
            100%{
                background-position: left -2160px;
            }
        }
        @keyframes SwimBox{
            0%{
                transform: translate(-600px);
            }
            100%{
                transform: translate(3000px);
            }
        }
        .smallfish {
            width: 175px;
            height: 125px; 
            margin: 100px auto;
            background: url(./老胡来也_23级H5CSS3练习_files/fish.png) left top; 
            animation: smallSwim 1s steps(8) infinite; 
            display: inline-block;
        }
        .box2 {
            width: 175px;
            height: 125px; 
            animation: smallBox 15s linear infinite;
            display: inline-block;
        }
        @keyframes smallSwim {
            0% {
                
            }
            100% {
                background-position: left -1000px;
            }
        }
        
        @keyframes smallBox {
            0% {
                transform: translateX(-500px) translateY(-140px);
            }
            25% {
                transform: translateX(300px) translateY(-140px) rotate(90deg);
            }
            50% {
                transform: translateX(300px) translateY(500px) rotate(180deg); 
            }
            75% {
                transform: translateX(-500px) translateY(500px) rotate(180deg); 
            }
            100% {
                transform: translateX(-500px) translateY(-140px) rotate(360deg);
            }
        } 
    </style>
</head>
<body>
    <div class="box1">
        <div class="bigfish"></div>
    </div>
    <div class="box2">
        <div class="smallfish"></div>
    </div>
</body>
</html>